package com.gator.desig_mode.combination;



import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ScheduledExecutorService;

/**
 * @author 何章怀晓 hezhanghuaixiao
 * @version V1.0
 * @desc
 */
public class Sys extends School {

  //实际指向的是班级
  private List<School> clazz = new ArrayList<>();


  public Sys(String name, String desc) {
    super(name, desc);
  }

  public Sys() {
  }

  @Override
  protected int add(School school) {

    boolean add = clazz.add(school);

    if (add) {
      return 1;
    }

    return 0;
  }

  @Override
  protected int rem(School school) {

    boolean remove = clazz.remove(school);
    if (remove) {
      return 1;
    }
    return 0;
  }


  @Override
  protected void print() {
    System.out.println("---" + getName() + " -----------");
    for (School item : clazz
    ) {
      item.print();
    }

  }
}
